credit-invoice method 抵扣型增值税
last invoice cost method [贸易] 最近进价法 ; 最终清单成本法
Last Invoice Price Method [贸易] 最后进价法
In this case, you could avoid the conditional logic by overloading the invoice method for different types.
在本例中,通过为不同类型重载invoice方法,您可以避免条件逻辑。
If you define an invoice method on a class, you have no way of knowing that some other user of that class won't define a different, incompatible method also named invoice.
如果您在类上定义invoice方法,则您没有办法知道该类的一些其他用户会不会定义不同的、不兼容的方法,还命名为invoice。
And this implementation is closed: After you compile the FulfillmentGenerator class, you can't extend the invoice method to new types without editing the source code and recompiling.
此实现是封闭的:在您编译FulfillmentGenerator类以后,在不编辑源代码和重新编译的情况下,您无法将invoice方法扩展到新的类型。
应用推荐